2. Pointed to the Darwin Committers page: http://www.opensource.apple.com/developer/developers.html
Once you get over the shock -- Emacs on a Mac? -- you want to get under the hood and see how this compares to other Linux distributions.
But of course it's not Linux. Darwin [1], the Open Source core of OS X, is based on BSD and Mach 3.0 (and, interestingly, runs on x86 computers as well as Macs).
***Cupertino Command Line
In /Applications/Utilities is Terminal, your gateway to the inner world of OS X. Do a cd /;ls and you'll note familiar directories -- bin, etc, sbin, tmp, Users, usr, var -- alongside directories such as Applications, Library, Trash, and so on.
A sample of the contents of /usr/bin shows that many of the expected tools are there: autoconf, bison, cvs, fetchmail, nslookup, perl, ssh, whoami, and so on.
And then, from the Mac side of OS X's heritage comes some unexpected tools. An example is osascript, which allows one to run an AppleScript script from the command line -- a feat one imagines the original AppleScript designers may not have envisioned.
There are some missing tools as well: no Python or Pine, for instance. And here's where Open Source developers are filling in the gaps.
While it's difficult to find much evidence of public participation in developing the kernel, it's easy to find people porting software to OS X. The OSXGNU [2] archive includes Python, bash (the OS X default is tcsh), Pine, and Lynx.
The Fink [3] project distributes ports of ant, MySQL, nmap, Ruby, and so on. The Fink guys are clearly not Unix newbies: "Fink uses Debian tools like dpkg and apt-get to provide powerful binary package management. You can choose whether you want to download precompiled binary packages or build everything from source."
There is a tendency one discovers: much of the software included with OS X is BSD- or MIT-licensed, while much of the software one downloads is GPLed. Though that's a just a rule of thumb, it's a definite contrast between OS X and Linux.
An example is Curl [4], available under the MIT license, instead of the more familiar GNU Wget [5].
***Server software
Though there is a separate OS X Server, OS X itself includes server software such as Apache, sendmail, named, and sshd. AppleTalk and Samba support are built-in.
Since OS X is so new, kinks are still being discovered. Since HFS+, the Mac's native file system, is not case-sensitive, a security was found in Apache. A URL that would be denied would be readable just by changing the case of the request. Apple responded with a new Apache module that enforces pseudo-case-sensitivity -- and which any build instructions [6] for Apache on OS X must take into account.
When you see the administrative interface for these servers, you suddenly realize anew that you're using a Mac.
IT Manager and Mac columnist John C. Welch calls OS X an "okay server, mostly due to hardware limitations and immaturity," while "Linux is an excellent server. It runs on more, and better hardware than Windows can ever dream of, thanks to IBM and Sun."
***In the beginning was the GUI
Macs are backwards -- it was only after more than 25 years that they got a command line. The desktop is where Apple has always done best.
You could say it's a dumbing down, or you could say that it's an ingenious interface designed to work for the greatest number of people -- turning on Apache is easy: in the GUI, open System Preferences, click on the Sharing icon, then click Start to turn on "Web Sharing" (aka Apache). You similarly turn on FTP and ssh access.
The command line is still there, for those who want: edit /etc/httpd/httpd.conf with your favorite editor, and you'll feel at home.
The GUI -- known as Aqua for it's watery, gum-droppy look -- is most definitely not Open Source.
It includes a file browser (the Finder) that mimics both the Classic Mac OS and the NeXT multi-column file browser, depending on how you use it. Most GUI apps are stored in /Applications.
There you'll find Microsoft Internet Explorer, Apple's Mail app, a calculator, a clock, TextEdit, and more.
Also available are some of Apple's jewels, including iTunes, a sort-of digital jukebox; Sherlock, which can search not just hard drives but the contents of files and the Web; iMovie, an easy-to-use movie editor.
In /Applications/Utilities one finds not just Terminal but AirPort Admin Utility, Console, Java Web Start, and the familiar-to-Mac-users Stuffit Expander.
Other developers have shipped titles such as Adobe Acrobat Reader, Adobe Illustrator, Netscape, and BBEdit (to Mac users the greatest text editor ever). Opera is in beta -- as are many other apps. Including, at this writing, Microsoft Office.
Compared to Linux, Brad Cox says, "The big draw is user interface consistency. Cmd-C is copy and Cmd-V is paste everywhere, unlike that cheesy select-for-copy/middle-click-for-paste of Linux which often does nothing at all. And BBEdit 6.5 is wonderful, steadily drawing me away from vim. Desktop apps work flawlessly, unlike flakey wannabes like Abiword and Staroffice."
However, Nicholas Riley reminds, "I still can't imagine my parents using 10.1."
***Office
It's been said that the Mac market would have completely withered away without the continued development of Microsoft Office [7]. Whether one likes it or not, Office, in some ways more so than Windows, is the standard in the business world.
It's a simple question: on what Unix system does Word and Excel run? Mac OS X.
***Open Source developers to the rescue, sort of
But of course Open Source developers can't just take all that lying down. Let's back up to Aqua.
XFree86 and XDarwin are available from the XonX project [8]. Yes, Virginia, there is an X-Windows server.
You can run XDarwin "rootless," meaning side-by-side with Aqua, or in its own window. The Fink folks even have GNOME [9] running on OS X.
OroborOSX [10], a port of the Oroboros window manager, "attempts to make X11 act in a more 'Mac-like' way (whether you like it or not!)"
At this writing, Photoshop for OS X isn't shipping yet, but you can run the GIMP [11] instead. (And you can also save a bunch of money and support Open Source developers.)
Developers are working on bringing OpenOffice to OS X [12], but it's been reported that it's slow going [13]. "I'm going to make a blatant plug here," said Bill Roth of Sun in Palo Alto, Calif. "We need people on this project."
***Developer Nirvana?
With every retail copy of OS X Apple ships a Developer Tools CD. These include the familiar cc and gdb along with Project Builder and Interface Builder, an IDE and user interface layout tool. This is a change -- to develop for Macs before OS X one had to purchase MPW or Metrowerks CodeWarrior.
Project Builder and Interface Builder have generated a certain amount of enthusiasm. Says Graeme Hiebert: "Project Builder is a very nice IDE, and Interface Builder is an amazing piece of work. Prior to Mac OS X, I've been pretty much a makefile guy, but I rarely use them any more."
Gabriel Ricard: "What I love the most about PB and IB is that I don't have to write a single line of code to create the interface. I just use IB to create the interface, write the classes and their selectors that the interface is attached to in IB, and build the app."
For writing GUI apps, one has a choice of writing to the Carbon [14] APIs, which are a revision of the classic Mac APIs, or using Cocoa [15], which is an updated version of the NeXT frameworks.
Carbon is the best bet for Mac developers porting classic apps to OS X since it means the least code changes.
Cocoa is recommended for new apps. Cocoa apps can be written in Objective-C or in Java. Objective-C is, like C++, a superset of C.
Aside from Carbon and Cocoa apps, one can create command-line tools, kernel extensions, plugins, pure Java apps, and frameworks with Project Builder.
Extensive examples, tutorials, and documentation are also included with the developer tools. However, these might not be extensive enough: various developers have called it "lousy" and "not really up to par yet."
While Apple seems to want you to develop for OS X, occasionally you run across things like this from the Darwin developer documentation [16]: "If you are thinking of writing code for the kernel environment, think carefully. Programming in the kernel can be a difficult and dangerous task. And often there is a way to accomplish what you want to do without touching the kernel... kernel software is a real pain to write."
While all that's true, one senses that there are shields up, however transparent, around the kernel. Note, however, that there is public participation, it isn't all Apple. See, for example, the list of Darwin Committers [17].
But, unless kernel hacking is what you really want to do, OS X can be developer nirvana. The Unix tools and scripting languages you're used to are there, and Project Builder and Interface Builder make building GUI apps relatively painless (once you learn the Cocoa frameworks).
Remember that this is the company that hit a home run with HyperCard. Suddenly programming was in reach of hobbyists and home users. The OS X version of HyperCard may be AppleScript Studio [18]. Not yet available at this writing, it promises "a set of professional application development tools featuring complete interface design and script writing with step-by-step debugging and source management."
Another candidate for the HyperCard of OS X is REALbasic [19], which creates stand-alone apps for classic and for OS X (and Windows) and has the reputation of being easy to use and easy to learn.
In his article "REALbasic for HyperCard Users," [19] Matt Neuburg writes "the Apple folks never really understood the brilliance of HyperCard, or how essential it was to the user community."
Perhaps that's changing now, with the inclusion of the Developer Tools CD, new apps that allow one to rapidly developer user interfaces, and OS X's Open Source, UNIX base.
***Links
[1] Darwin: http://www.publicsource.apple.com/projects/darwin/
[2] OSXGNU: http://www.osxgnu.org/software/index.html
[3] Fink: http://fink.sourceforge.net/
[4] Curl: http://curl.haxx.se/
[5] Wget: http://www.gnu.org/software/wget/wget.html
[6] build instructions: http://www.stepwise.com/Articles/Workbench/2001-10-11.01.html
[7] Microsoft Office: http://www.microsoft.com/mac/officex/default.asp
[8] X on X project: http://sourceforge.net/projects/xonx
[9] GNOME: http://fink.sourceforge.net/pdb/section.php/gnome
[10] OroborosX: http://wrench.et.ic.ac.uk/adrian/software/oroborosx/
[11] GIMP: http://www.macgimp.org/
[12] Open Office to OS X: http://porting.openoffice.org/mac/
[13] slow going: http://www.zdnet.com/zdnn/stories/news/0,4586,2784625,00.html
[14] Carbon: http://developer.apple.com/techpubs/macosx/Carbon/carbon.html
[15] Cocoa: http://developer.apple.com/techpubs/macosx/Cocoa/CocoaTopics.html
[16] Darwin developer documentation: http://developer.apple.com/techpubs/macosx/Darwin/ShouldYou.html
[17] Darwin committers: http://www.opensource.apple.com/developer/developers.html
[18] AppleScript Studio: http://www.apple.com/applescript/macosx/ascript_studio/
[19] REALbasic for HyperCard Users: http://www.oreillynet.com/pub/a/mac/2001/09/20/realbasic.html
[19] REALbasic: http://www.realbasic.com/